package com.violet.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Data
@Component
@ConfigurationProperties(prefix = "file-upload")
public class FileUploadProperties {
   // 图片上传相关配置
   private Image image;

   public record Image(String path, String url, Integer maxSize) {
       public Image {
           if (path == null) path = "";
           if (url == null) url = "";
           if (maxSize == null) maxSize = 5;
       }
   }
}
